import { BasicFetchResult } from '/@/api/model/baseMode';
import { defHttp } from '/@/utils/http/axios';

import { ErrorMessageMode } from '/@/utils/http/axios/types';

enum Api {
  // List = '/bannerManager/findPage',
  List = '/sellHousesBaseManager/findPage',
  Delete = '/sellHousesBaseManager/delSellHouseList/',
  State = '/sellHousesBaseManager/updateStatus',
}

/**
 * @description: 查询意向列表
 */
export function ListApi(params, mode: ErrorMessageMode = 'modal') {
  return defHttp.get<BasicFetchResult<any>>(
    {
      url: Api.List,
      params,
    },
    {
      errorMessageMode: mode,
    }
  );
}
/**
 * @description: 删除
 */
export function DeleteApi(params, mode: ErrorMessageMode = 'modal') {
  return defHttp.get<BasicFetchResult<any>>(
    {
      url: Api.Delete + params,
    },
    {
      errorMessageMode: mode,
    }
  );
}
/**
 * @description: 改变状态
 */
export function EditStateApi(params, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicFetchResult<any>>(
    {
      url: Api.State,
      params,
    },
    {
      errorMessageMode: mode,
    }
  );
}
